package algothrim

import "fmt"

type Node struct {
	Val   int
	Nodes []*Node
}

func dfs(root *Node) {
	if root == nil {
		return
	}

	fmt.Println(root.Val)

	for _, node := range root.Nodes {
		dfs(node)
	}
}

func bfs(root *Node) {
	if root == nil {
		return
	}

	queue := []*Node{root}

	for len(queue) > 0 {
		node := queue[0]
		queue = queue[1:]

		fmt.Println(node.Val)

		for _, n := range node.Nodes {
			queue = append(queue, n)
		}
	}
}
